<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>汽车之家</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <meta name="x5-fullscreen" content="true">
    <meta name="full-screen" content="yes">
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <script type="text/javascript">
        document.documentElement.style.fontSize = window.innerWidth/3.75 + 'px'
    </script>
</head>
<body>
    <!-- <header></header> -->
<section class="bg1">
    <div class="logo"><img src="images/logo.png"></div>
    <div class="fourWrap top_rem">
        <div class="fourTip">
            <img src="images/arrowUp.png" alt="">
            <p>输入您的大名(必填)</p>
            <img src="images/arrowUp.png" alt="">
        </div>
        <div><input type="text" id="name" placeholder="请输入姓名" value=""></div>
        <div class="fourTip">
            <img src="images/arrowUp.png" alt="">
            <p>任选一个“炫耀”指南</p>
            <img src="images/arrowUp.png" alt="">
        </div>
        <div class="fourList active"><p>XXX昨日怒提新车</p><p>“左手事业 右手家庭”</p></div>
        <div class="fourList"><p>太膨胀！XXX买车眼都不眨</p><p>“要全款，我不喜欢贷款”</p></div>
        <div class="fourList"><p>一高兴就买车，XXX真任性</p><p>“买台车而已，别惊讶”</p></div>
    </div>
    <div class="up_btn2">
        <a href="javascript:gofive()">选择完毕，点击确认</a>
    </div>
</section>
<script src="js/jquery.js"></script>
<script src="js/common.js"></script>
<script>
    $('.fourList').mouseup(function () {
        $(this).addClass('active').siblings('.fourList').removeClass('active');
    });

    function gofive() {
        //判断是否写全了
        var name = $("#name").val()

        if(name) {
            localStorage.setItem("name", name);
        } else {
            alert('请填写您的姓名')
            return false
        }
        var text = 1;
        var active_text = $(".active").html();
        if(active_text == '<p>太膨胀！XXX买车眼都不眨</p><p>“要全款，我不喜欢贷款”</p>') {
            text = 1;
        }
        switch (active_text) {
            case '<p>“左手事业 右手家庭”</p><p>XXX昨日怒提新车</p>':text = 1;break;
            case '<p>“要全款，我不喜欢贷款”</p><p>太膨胀！XXX买车眼都不眨</p>':text = 2;break;
            case '<p>“买台车而已，别惊讶”</p><p>一高兴就买车，XXX真任性</p>':text = 3;break;
        }
        //获取选择的文字
        localStorage.setItem("text", text);
        window.location.href='five.html'

    }
</script>
</body>
<!-- <script src="js/jquery.js"></script> -->
<!-- <script src="js/index.js"></script> -->
</html> 